package cn.example.project1.service.impl;

import cn.example.project1.dao.WordDAO;
import cn.example.project1.po.Word;
import cn.example.project1.service.WordService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;

/**
 * Created by WuYB on 2017/9/27.
 */
@Service
public class WordServiceImpl implements WordService {

    @Resource
    private WordDAO wordDAO;

    @Override
    public int save(Word word) {
        return wordDAO.insert(word);
    }

    @Override
    public byte[] getWordByID(int id) {
//        Map<String, Object> cc = wordDAO.getWordByID(id);
//        return (byte[]) cc.get("word");
        return (byte[]) wordDAO.getByteByID(id);
    }

}
